Copyright(C) 1994 Terumasa KODAKA , Takeshi KONO


■Graphic BIOS [Normal]
                 Overview of the Graphic BIOSIn normal mode, the ROM program provides the Graphic BIOS and Graph LIO for graphic drawing.
                 The Graphic BIOS supports the standard graphics modes of monochrome and 8 color. It mainly includes functions for drawing with the graphic GDC.
                 Graph LIO supports the standard graphics modes of monochrome, 8 color, and 16 color, and supports more complex drawing functions than the Graphic BIOS.
                 The Graphic BIOS and Graph LIO do not support the extended graphics mode or the H98 256 color mode.
                 The Graphic BIOS and Graph LIO are explained in detail in the Technical Data Book.
                 This book provides a minimum explanation of the Graphic BIOS, and omits the Graph LIO. However, it does provide detailed information
                 about some functions in the Graphic BIOS that contain confidential information or points of caution.

                 Table [Graphics modes in normal mode for PC-9800]
                 Normal---+---Standard graphics---+---Monochrome-----+---640x200 dots*
                          |                       |                  ^---640x400 dots
                          |                       +---8 color--------+---640x200 dots*
                          |                       |                  ^---640x400 dots
                          |                       +---16 color-------+---640x200 dots*
                          |                                          ^---640x400 dots
                          +---Extended graphics (256 colors)---------+---640x400 dots
                          |                                          ^---640x480 dots
                          +---H98 256 colors-------------------------+---640x200 dots
                                                                     ^---640x400 dots

               * Only the modes marked with an asterisk can be displayed on the standard display (PC-8001 display
                 with CRT resolution = 640x200, horizontal scan frequency = 15.98kHz, vertical sync frequency = 61.47Hz).

               ・"Standard graphics" is a graphics system that is required for PC-9800 normal mode.
                 However, the original PC-9801, E, F, and M do not have 16-color functionality.
                 PC-9801U, VM2, and VF have optional VRAM for 16-color functionality.
               ・"Extended graphics" is supported by PC-9821 (except Bf, Bp, Bs, Be, and Ts).
               ・"H98 256 colors" is supported by PC-H98 + PC-H98-E02 (256-color board) (PC-H98 model 80, 90, and 105, PC-H98T model 2C come standard with a 256-color board).
               ・The "GS Extended Graphics" of the PC-98GS is an independent graphics system that can coexist with the "Standard Graphics", so it is not included here.


INT 18h - Function 40h
Classification   GRAPH BIOS
Name             Start displaying the graphics screen
Target           Normal
Input            AH=40h
Output           None
Explanation    o Turns on the display of the graphics screen. Display is OFF at startup.
               o Also valid in Extended Graphics Mode and PC-H98 256-Color Mode.
               u This function waits for the next VSYNC to occur before executing the actual process. To know when VSYNC occurs,
                 the GDC status (I/O 00A0h) is checked. For this reason, VSYNC interrupts used by other routines, such as INT 18h - Function 0Ah, will not stop.
Related          0000:054Ch bit 7
                 INT 18h - Function 41h


INT 18h - Function 41h
Classification   GRAPH BIOS
Name             Stop graphic screen display
Target           Normal
Input            AH=41h
Output           None
Explanation    o Turns off the graphic screen display.
               o Also valid in extended graphics mode and PC-H98 256-color mode.
Related          0000:054Ch bit 7
                 INT 18h - Function 40h


INT 18h - Function 42h
Classification   GRAPH BIOS
Name             Display area setting
Target           Normal + Standard graphics mode
Input            AH=42h
                 CH=Mode setting information

                 bit 7,6:VRAM area (resolution) specification
                 -------+---------------------+------------------
                 Value  | Graphics resolution | Notes
                 -------+---------------------+------------------
                 11b    | 640x400             |
                 10b    | 640x200(LOWER)      |
                 01b    | 640x200(UPPER)      | Startup setting
                 -------+---------------------+------------------

                 bit 5:Color/monochrome specification
                 ------+------------
                 Value | Contents
                 ------+------------
                 1     | Monochrome
                 0     | Color
                 ------+------------

                 bit 4:Display bank
                 ------+----------+------------------------------
                 Value | Contents | Notes
                 ------+----------+------------------------------
                 1     | Bank 1   | Cannot be specified on PC-9801 first generation/U
                 0     | Bank 0   |
                 ------+----------+------------------------------

                 Set bits 3-0:0000b (unused)
Output           None
Explanation    o Sets the graphics mode of the standard graphics mode.
               u When executed in extended graphics mode, the behavior is as follows.
               ・Display frequency ... No change
               ・Number of colors When set to 640x400 ... No change (remains in extended graphics mode)
                 When set to 640x200 ... 16-color mode

                 However, when this function is executed on the PC-9821 first generation/Ne in extended graphics mode at 640x480 dots,
                 it will not work. This is because an error occurs when an attempt is made to set the resolution to 640x400 dots with
                 the horizontal scanning frequency remaining at 31kHz internally.

                 On the PC-9821 (except the Ts), the graphics resolution is stored in the system common area 0000:0597h bit 1,0.
                 On other models, the settings of this function are not stored in the system common area.

Related          0000:0597h bit 1,0


INT 18h - Function 43h
Classification   GRAPH BIOS
Name             Palette register setting
Target           Normal + Standard graphics mode + Monochrome/8-color
Input            AH=43h
                 DS:BX=Start address of UCW
                 <Contents of UCW's GBCPC (offset 04h, size 4 bytes)>
                 --------+---------+-------------------------------
                 Address | Bit     | Contents
                 --------+---------+-------------------------------
                 DS:BX+4 | bit 7-4 | Palette register 6
                         | bit 3-0 | Palette register 7
                 --------+---------+-------------------------------
                 DS:BX+5 | bit 7-4 | Palette register 4
                         | bit 3-0 | Palette register 5
                 --------+---------+-------------------------------
                 DS:BX+6 | bit 7-4 | Palette register 2
                         | bit 3-0 | Palette register 3
                 --------+---------+-------------------------------
                 DS:BX+7 | bit 7-4 | Palette register 0
                         | bit 3-0 | Palette register 1
                 --------+---------+-------------------------------

                 Bit allocation for each palette register
                 --------+------------
                 Bit     | Contents
                 --------+------------
                 bit 7,3 | Set to 0
                 bit 6,2 | G
                 bit 5,1 | R
                 bit 4,0 | B
                 --------+------------
Output           None
Explanation    o Sets the color palette for 8-color mode and specifies the composite method for the display screen in monochrome mode.
               o The graphic BIOS cannot specify the palette for 16-color mode.
Related          I/O 00A8h
                 I/O 00AAh
                 I/O 00ACh
                 I/O 00AEh


INT 18h - Function 44h
Classification   GRAPH BIOS
Name             Border color setting
Target           Normal + Standard display
Input            AH=44h
                 DS:BX=Start address of UCW
                 <Contents of GBBCC of UCW (offset 01h, size 1 byte)>
                 --------+---------+-------------------------------
                 Address | Bit     | Border color
                 --------+---------+-------------------------------
                 DS:BX+1 | bit 7   | Set 0
                         | bit 6   | GREEN
                         | bit 5   | RED
                         | bit 4   | BLUE
                         | bit 3-0 | Set 0000b
                 --------+---------+-------------------------------
Output           None
Explanation    o Sets the border color when using a standard display.
               u When the horizontal scan frequency is 24kHz, the color is added around the edge of the display's drawing area.
                 Unlike the original border color, the color does not extend all the way to the edge of the display.
                 Also, on some monitors (such as the SONY GVM-1411), the display color becomes abnormal when
                 you specify a border color at a horizontal scanning frequency of 24 kHz.
Related          I/O 006Ch


INT 18h - Function 45h
Classification   GRAPH BIOS
Name             Dot writing
Target           Normal + Standard graphics mode + Monochrome/8-color
Input            AH=45h
                 CH=Screen specification
                   bit 7,6:VRAM area specification
                     ------+------------------
                     Value | Graphics resolution
                     ------+------------------
                     10b   | 640x400
                     01b   | 640x200(UPPER)
                     00b   | 640x200(LOWER)
                     ------+------------------
                   bit 5,4:Drawing plane
                     ------+------------
                     Value | Contents
                     ------+------------
                     11b   | Plane 1, 2, 3
                     10b   | Plane 3
                     01b   | Plane 2
                     00b   | Plane 1
                     ------+------------
                   Set bits 3-0:0000b (unused)
                 ES=Segment address of drawing pattern buffer
                 DS:BX=Start address of UCW
Output           None
Explanation    o Writes a dot pattern of a certain length to the specified screen.
               o For details on UCW, see the Technical Data Book BIOS.
Related


INT 18h - Function 46h
Classification   GRAPH BIOS
Name             Dot reading
Target           Normal + Standard graphics mode + Monochrome/8-color
Input            AH=46h
                 CH=Screen specification (same as INT 18h - Function 45h)
                 ES=Segment address of read buffer (1-3)
                 DS:BX=Start address of UCW
Output           None
Explanation    o Reads a dot pattern of a certain length from the specified screen.
               o For details on UCW, see the Technical Data Book BIOS.
Related


INT 18h - Function 47h
Classification   GRAPH BIOS
Name             Drawing lines and rectangles
Target           Normal + Standard graphics mode + Monochrome/8-color
Input            AH=47h
                 CH=Screen specification (same as INT 18h - Function 45h)
                 DS:BX=Start address of UCW
Output           None
Explanation    o Writes lines or rectangles to the specified screen.
                 Draws with GDC.
               o For details on UCW, see the BIOS section of the Technical Data Book.
Related


INT 18h - Function 48h
Classification   GRAPH BIOS
Name             Drawing arcs
Target           Normal + Standard graphics mode + Monochrome/8-color
Input            AH=48h
                 CH=Screen specification (same as INT 18h - Function 45h)
                 DS:BX=Start address of UCW
Output           None
Explanation    o Writes arcs to the specified screen.
                 Because it draws with GDC, it is not possible to draw arcs that are part of an ellipse.
               o For details on UCW, see the BIOS section of the Technical Data Book.
Related


INT 18h - Function 49h
Classification   GRAPH BIOS
Name             Graphic character drawing
Target           Normal + Standard graphics mode + Monochrome/8-color
Input            AH=49h
                 CH=Specify drawing screen (same as INT 18h - Function 45h)
                 DS:BX=Start address of UCW
Output           None
Explanation    o Writes a pattern of 8x8 dots or less to the specified screen.
                 It is also possible to fill an area larger than 8x8 dots with a repeating pattern of 8x8 dots or less.
               o For details on UCW, see the BIOS section of the Technical Data Book.
Related


INT 18h - Function 4Ah
Classification   GRAPH BIOS
Name             Drawing mode setting
Target           Normal + Standard graphics mode
Input            AH=4Ah
                 CH=Drawing timing setting
                   16h=Flashless drawing
                   06h=Flash drawing
Output           None
Explanation    o Specifies the drawing timing for the graphics GDC.
                 On the original PC-9801, E, F, M, U, VM2, and VF, if you set it to flash drawing, flickering will occur when drawing with the GDC.
                 With flashless drawing, drawing is only performed during blanking periods, so there is no flickering.
                 When drawing with the CPU, there is no flickering even with flash drawing.
               u The drawing timing setting state is saved in the system common area 0000:054Dh bit 3.
                 On models with u 0000:054Dh bit 4=1 (other than the original PC-9801, E, F, M, U, VM2, and VF), regardless of
                 the setting made by this function, it will always operate in the same way as flashless drawing.
               u If 0000:054Ch bit 0=1 (DIP SW 1-8=ON: extended graphics mode), no processing is performed. This is because
                 in extended graphics mode, the GDC is always set to flash drawing mode in the ITF.
               o The value of CH is the value of the first parameter when sending a SYNC command to the graphics GDC.
                 For this reason, values other than 06h or 16h should not be specified.
Related          0000:054Dh bit 4,3


INT 18h - Function 4Dh
Classification   GRAPH BIOS
Name             Extended/standard graphics mode selection at 400 lines
                 Undocumented
Target           PC-9821 (excluding Bf, Bp, Bs, Be, Ts) + Normal
Input            AH=4Dh
                 CH=Graphics mode
                   00h=Standard graphics (2/8/16 colors) mode
                   01h=Extended graphics (256 colors) mode
Output           None
Explanation    o Selects standard/extended graphics mode when displaying at 640x400 graphics resolution.
                 Valid only when the graphics resolution is 640x400 display mode. At other graphics resolutions, it does nothing and ends.
               u System common area 0000:054Dh bit 7 indicates the current graphics mode. There is no BIOS function that
                 reads this status. If you need to read the current mode, refer to the system common area directly.
               u On the original PC-9821, if you execute this function when it is not line 400, 0000:054Dh bit 2
                 (a flag indicating the current GDC clock state) will always be set to 1 (5MHz state).
                 On the original PC-9821, Af, Ap, As, Ae, or Ce, the same result will occur when you execute it with a value other than CH=00h, 01h.
                 On the PC-9821Ap2, As2, Cs2, or Ce2, the same result will occur when you execute it with CH=00h when it is line 400.
               o The PC-98GS and PC-9821Bf, Bp, Bs, Be, and Ts do not support this function.
Related          INT 18h - Function 30h
                 0000:054Dh bit 7


INT 18h - Function 4Bh,4Ch,4Eh,4Fh
Classification   GRAPH BIOS
Name             No function
Target           Normal
Input            AH=4Bh,4Ch,4Eh,4Fh
Output           None
Explanation    o
Related


INT 18h - Function 50~FFh
Classification   GRAPH BIOS
Name             Execution prohibited
                 Undocumented
Target           Normal
Input            AH=50~FFh
Output
Explanation    o Dispatching without checking the AH range will cause the program to go out of control if executed.
Related